// JavaScript Document change password form
var path=$('#path').val();
$(document).ready(function(e) {
document.frm1.reset();
 $('#frm1').validationEngine();
    $('#old_password')
		.focusout(function(){
			$.post('get_old_pwd',{'op':$(this).val()},
			function(result){
				if(result!=1) jAlert(result);
			})
		})
		.keypress(function(e){
			if(e.which==13)
			{
				$('#new_password').focus().select();
			}
		})
	$('#re_new_password')
		.focusout(function(){
			if($(this).val()!=$('#new_password').val())
			{
				jAlert('Passowrd no match, please check again\n'+$(this).val()+' = '+$('#new_password').val(),'Ziebar Alert');
			}
		})
		.keypress(function(e){
			if(e.which==13)
			{
				$('#b_Save').focus().select();
			}
		})
		
	$('#b_Save').click(function(){
	 if($('#frm1').validationEngine('validate')){
		$.post('set_new_pwd',{'np':$('#new_password').val()},
		function(result){
			jAlert(result);
			document.location.href='log_out';
		})
	 }
	})

});
